﻿<phone:PhoneApplicationPage 
    xmlns:local="clr-namespace:MTGScore_Cards"
    local:TiltEffect.IsTiltEnabled="True"
    x:Class="MTGScore_Cards.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True"
    xmlns:toolbox="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    Loaded="PhoneApplicationPage_Loaded"
    >

  
    <Grid x:Name="LayoutRoot" Background="Transparent">

        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="0" />
        </Grid.RowDefinitions>
        <!--Pivot Control-->
        <controls:Pivot Title="{Binding Path=Strings.Title, Source={StaticResource LocalizedStrings }}" Name="PivotControl">

            <!--Pivot item one-->

            <controls:PivotItem Name="SearchPivot_Name" Header="{Binding Path=Strings.Search, Source={StaticResource LocalizedStrings }}" >
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="250*" />
                        <ColumnDefinition Width="150*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="110*" />
                        <RowDefinition Height="50*" />
                        <RowDefinition Height="350*" />
                        <RowDefinition Height="150*" />
                        <RowDefinition Height="150*" />
                    </Grid.RowDefinitions>
                    <!--<phone:WebBrowser HorizontalAlignment="Left" Name="webBrowser_History" VerticalAlignment="Top" Height="424" Width="454" Visibility="Collapsed" />-->
                    <toolbox:PerformanceProgressBar Name="ToggleProgressBar" Grid.Row="1" Grid.ColumnSpan="2" Height="30" />
                    <!--<ListBox Name="Results_List" SelectionMode="Single" VerticalContentAlignment="Center" HorizontalContentAlignment="Left"  SelectionChanged="Results_List_SelectionChanged">

                    </ListBox>-->

                    <ListBox x:Name="Results_List" Margin="0,0,-12,0" ItemsSource="{Binding Cards}" SelectionChanged="Results_List_SelectionChanged" SelectionMode="Single" Grid.Row="2" Grid.ColumnSpan="2" Grid.RowSpan="1">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Margin="0,0,0,17">
                                    <TextBlock Text="{Binding Name}" TextWrapping="NoWrap" Margin="12,0,0,0" Style="{StaticResource PhoneTextLargeStyle}"/>
                                    <TextBlock Text="{Binding Description}" TextWrapping="NoWrap" Margin="12,-6,0,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>


                    <TextBox Height="70" HorizontalAlignment="Stretch" Name="Search_Text_Area" Text="" VerticalAlignment="Stretch" Width="290"  Grid.RowSpan="1" KeyDown="Search_Text_Area_KeyDown" />
                    <Button Content="{Binding Path=Strings.Search, Source={StaticResource LocalizedStrings }}" Grid.Column="1" Grid.RowSpan="1" Height="72" HorizontalAlignment="Stretch" Name="Search_Button" VerticalAlignment="Stretch" Width="150" Click="Search_Button_Click" />
                    <Button Content="{Binding Path=Strings.BuyFullVersion, Source={StaticResource LocalizedStrings }}" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" Name="Ads1_Button" VerticalAlignment="Stretch" Click="Ads1_Button_Click" />
                    <Button Content="{Binding Path=Strings.OtherProducts, Source={StaticResource LocalizedStrings }}" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" Name="Ads2_Button" VerticalAlignment="Stretch" Click="Ads2_Button_Click" Visibility="Collapsed"/>
                    <Grid Name="AdControlGrid" xmlns:adctl="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI" Grid.Row="4" Grid.ColumnSpan="2">
                        <adctl:AdControl Name="AdControl" Height="80" Width="480" AdUnitId="32126" ApplicationId="a62110a4-daf5-481c-a39e-12e3169f10f0" AdModel="Contextual" AdControlError="AdControl_AdControlError" />
                    </Grid>
                </Grid>

            </controls:PivotItem>

            <controls:PivotItem Name="AdsPivot_Name" Header="{Binding Path=Strings.OtherProducts, Source={StaticResource LocalizedStrings }}" >
                <Grid>

                    <!--<phone:WebBrowser HorizontalAlignment="Left" Name="webBrowser_History" VerticalAlignment="Top" Height="424" Width="454" Visibility="Collapsed" />-->
                    <ListBox x:Name="Ads_List" Margin="0,0,-12,0" ItemsSource="{Binding Ads}" SelectionChanged="Ads_List_SelectionChanged" SelectionMode="Single" >
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Margin="0,0,0,17">
                                    <Image Source="{Binding ImageUri}" Width="60" Height="60" Margin="60,0,0,0" HorizontalAlignment="Left" />
                                    <TextBlock Text="{Binding Name}" TextWrapping="NoWrap" Margin="150,-70,0,0" Width="300" Style="{StaticResource PhoneTextLargeStyle}"/>
                                    <TextBlock Text="{Binding Description}" TextWrapping="Wrap" Margin="150,-25,0,0" Width="300" Style="{StaticResource PhoneTextSubtleStyle}"/>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>

                </Grid>

            </controls:PivotItem>


        </controls:Pivot>

        


    </Grid>
    
    
    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <!--<shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>-->
            <shell:ApplicationBar.MenuItems>
                <!--<shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>-->
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>